<?php
//рус
include_once (_CORE_PATH . "decorator_prototype.php");

class decorator_admin extends decorator_prototype_class
{
    private $_activeMenuElement;
    /**
		устаавливает активный элемент в меню основного шаблона
     */
    public function SetMenuActiveElement ($menuElement)
    {
        $this->_activeMenuElement = $menuElement;
        return $this;
    }
    
    public function GetMenuActiveElement ()
    {
        return $this->_activeMenuElement;
    }     
    
    protected function GetMainMenu()
    {
        $t = $this->GetTemplator();
        $t->userMenu = $this->_ctrls->default->GetUserMenuFromCache();
        $t->menuActiveElement = $this->GetMenuActiveElement();
        return $t->render('_main_menu.phtml');    	
    }
    
    /**
		шаблон default
     */
    protected function DefaultTmp ()
    {
        $this->SetDefaultHeaders();
        $this->Response()->SetHeader('Content-Type', 'text/html; charset=UTF-8');
        
        $t = $this->GetTemplator();
        $t->siteName = MozgCfg::GetProp('site/global//siteName');
        $t->mainMenu = $this->GetMainMenu();
        $t->userStatus = $this->_ctrls->users->get_userstatus();
        $t->leftPane = $this->GetSecondAction('Left Sidebar');
        $t->rightPane = $this->GetSecondAction('Right Sidebar');
        $t->bottomScript = $this->GetSecondAction('Bottom Script');
        $t->content = $this->Response()->GetBody();
        $t->messages = $this->Libs()->messanger->getAllMessages();
        $t->user = $this->GetModule()->GetUser();
        
        $t->activeRoute = MozgRoute::Get('http')->GetActiveRoute();
        
        $t->style = SysLoader::GetModule('media', 'http', '_web')->GetCtrl('style');
        
        $this->Response()->SetBody($t->render('_template.phtml'));
    }
    /**
		шаблон login
     */
    protected function LoginTmp ()
    {
        $this->SetDefaultHeaders();
        $this->Response()->SetHeader('Content-Type', 'text/html; charset=UTF-8');
        $t = $this->GetTemplator();
        $t->siteName = MozgCfg::GetProp('site/global//siteName');
        $t->basePath = $this->GetModule()->GetRequest()->GetBasePath();
        $t->content = $this->Response()->GetBody();
        $t->messages = $this->Libs()->messanger->getAllMessages();
        $t->style = SysLoader::GetModule('media', 'http', '_web')->GetCtrl('style');
        
        $this->Response()->SetBody($t->render('_login_template.phtml'));
    }  

    /**
		шаблон std
     */
    protected function StdTmp ()
    {
        
    }    
}